<?php
namespace Emos\Field;

use Emos\Common;

class ExpandableSet extends ItemSet {
    public $title = null;
    
    public function __construct($title=null) {
        $this->title = $title;
    }


    public function getTemplate() {
        ob_start();
        
        $title = ($this->title === null) ? Common::t('expand') : $this->title;
        
        print "<div class='expandableSet'>";        
        print "  <div class='expandHandler'><a href='#'><img src='/emos/images/open_branch.png' align='absmiddle'>{$title}</a></div>";        
        print "    <div class='expandBody'>";
        print "       ".parent::getTemplate()."";
        print "    </div>";
        print "</div>";
        
        return ob_get_clean();
    }
}